import time

# 带参数的装饰器，用来计算函数运行的时间
def exectime(exec_count):
    def decorator(fn):
        def inner(*args, **kwargs):
            t1 = time.time()
            for i in range(exec_count):
                result = fn(*args, **kwargs)
            t2 = time.time()
            print("执行任务耗时:", t2-t1)
            return result
        return inner
    return decorator


